package point;

public class Point {
	
	private int row, col;
	private static int size;
	
	public Point(int x, int y) {
		row = x;
		col = y;
	}
	
	public static void setSize(int size) {
		Point.size = size;
	}
	
	public boolean equals(Object o) {
		if(o == this)
			return true;
		
		Point p = (Point) o;
		
		if(p.col == col && p.row == row)
			return true;
		else
			return false;
	}
	
	public int[] getCoordinates() {
		return new int[]{row, col};
	}
	
	public int getRow() {
		return row;
	}
	
	public int getColumn() {
		return col;
	}
	
	public void north() {
		if(row > 0)
			row = row - 1;
	}
	
	public void south() {
		if(row < size - 1)
			row = row + 1;
	}
	
	public void west() {
		if(col > 0)
			col = col - 1;
	}
	
	public void east() {
		if(col < size - 1)
			col = col + 1;
	}
}
